package com.enation.app.javashop.api.client;

import com.enation.app.javashop.model.statistics.dto.ShopData;
import com.enation.app.javashop.service.statistics.ShopDataManager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import springfox.documentation.annotations.ApiIgnore;

/**
 * 店铺收藏数据管理
 *
 * @author chopper
 * @version v1.0
 * @Description:
 * @since v7.0
 * 2018/5/8 下午4:11
 */
@RestController
@RequestMapping("/client/statistics")
@Validated
@ApiIgnore
public class ShopDataClientController {

    @Autowired
    private ShopDataManager shopDataManager;
    /**
     * 修改店铺收藏数量
     *
     * @param shopData
     */
    @RequestMapping(value = "/shop/collection", method = RequestMethod.POST)
    public void updateCollection(@RequestBody ShopData shopData){
        shopDataManager.updateCollection(shopData);
    }

    /**
     * 添加数据
     *
     * @param shopData
     */
    @RequestMapping(value = "/shop/put", method = RequestMethod.POST)
    public void add(@RequestBody ShopData shopData){
        shopDataManager.add(shopData);
    }


    /**
     * 修改店铺收藏数量
     *
     * @param shopData
     */
    @RequestMapping(value = "/shop/data", method = RequestMethod.PUT)
    public void updateShopData(@RequestBody ShopData shopData){
        shopDataManager.updateShopData(shopData);
    }


}
